﻿import enum


class ErrorCode(enum.Enum):
    SUCCESS = 0

    #业务错误
    USERID_OR_PASSWORD_ERROR = -1
    USERID_ALREADY_EXISTS = -2
    USERID_NOT_EXISTS = -3
    USERID_NOT_INVALID = -4
    USERID_OR_PASSWORD_IS_EMPTY = -5
    INVALID_TOKEN = -6
    ORIG_PASSWORD_ERROR = -7
    NEW_PWD_AND_REPEAT_PWD_NOT_EQUAL = -8
    USERID_ALREADY_FROZEN = -9
    USERID_HAS_NO_PERMISSION = -10
    CREATE_USER_FAILED = -11

    EMAIL_PATH_ERROR = -12
    SEND_EMAIL_ERROR = -13
    SEND_EMAIL_SUCCESS_MOD_STATUS_FAILED = -14
    PHONE_FORMAT_INVALID = -15
    EMPLOYEE_MOD_SUCCESS_BUT_USER_MOD_FAILED = -16
    STUDENT_MOD_SUCCESS_BUT_USER_MOD_FAILED = -17
    NOTICE_NOT_EXISTS_OR_STATUS_NOT_ALLOW_MOD = -18
    EMPLOYEE_ALREADY_EXITS = -19
    CLASS_ALREADY_FINISHED = -20
    UPLOAD_FILE_FAILED = -21
    NOTICE_TOPIC_OR_CONTENT_IS_EMPTY = -22
    STUDENT_NOT_EXISTS = -23

    #核心错误


    # 数据库错误
    DATABASE_MANUAL_ROLLBACK_FAILED = -9997
    DATABASE_RECORD_NOT_FOUND = -9998
    DATABASE_ERROR = -9999




